<?php session_start();

require_once('Fachada.php');
// Incluindo o imgSet.php que seta os valores da sess�o.
require_once ($_SERVER["DOCUMENT_ROOT"] . '/Esquina_da_TI/GUI/imgSet.php');
require_once ($_SERVER["DOCUMENT_ROOT"] . '/Esquina_da_TI/ClassesBasicas/Privilegio.php');

$priv = $_SESSION['privilegio'];

if($priv != Privilegio::EDITOR){
    echo "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=/Esquina_da_TI/GUI/EfetuarLogin.php'>";
}

$fachada = new Fachada();

if($_SESSION['ultimaAcaoMinhaConta'] != "CADASTRONOTICIA") {
    unset($_SESSION["menssagemErro"]);
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <h1>Cadastrar Notícias</h1>
        <form id="cadNoticia" name="cadNoticia" method="post" action="ControleCadastroNoticia.php">
            <table>
                <tr>
                    <th>Titulo da Notícia:</th>
                    <th align="left"><input name="tituloNoticia" type="text" id="tituloNoticia" size="68"></th>
                </tr>
                <tr>
                    <th>Resumo da Notícia:</th>
                    <td><textarea name="resumoNoticia" id="resumoNoticia" cols="50" rows="3"></textarea></td>
                </tr>
                <tr>
                    <th>Noticia Completa: </th>
                    <td><textarea name="noticia" id="noticia" cols="50" rows="6"></textarea></td>
                </tr>
                <tr>
                    <th>Email do autor: </th>
                    <td><input name="emailAutor" id="emailAutor" type="text" size="68"></td>

                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>

                <tr>
                    <th></th>
                    <td><div align="right">
                            <input type="submit" value="Cadastrar Noticia">
                        </div></td>
                </tr>
            </table>
        </form>
    </body>
</html>
